package com.example.zhang;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity_kiss extends AppCompatActivity {
    TextView one,two,three;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_kiss);

        one = findViewById(R.id.Ed1);
        two = findViewById(R.id.Ed2);
        three = findViewById(R.id.Ed3);



        Intent conf =getIntent();
        float my_kiss = conf.getFloatExtra("my",0.0f);
        float yb_kiss = conf.getFloatExtra("yb",0.0f);
        float hy_kiss = conf.getFloatExtra("hy",0.0f);

        one.setText(String.valueOf(my_kiss));
        two.setText(String.valueOf(yb_kiss));
        three.setText(String.valueOf(hy_kiss));
        }

        public void save(View btn){
        float one_kiss=Float.parseFloat(one.getText().toString());
        float two_kiss=Float.parseFloat(two.getText().toString());
        float three_kiss=Float.parseFloat(three.getText().toString());
        Intent intent = getIntent();
        Bundle bdl = new Bundle();
        bdl.putFloat("my_kiss",one_kiss);
        bdl.putFloat("yb_kiss",two_kiss);
        bdl.putFloat("hy_kiss",three_kiss);
        intent.putExtras(bdl);
        setResult(2,intent);
        finish();
        }

    }
